using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using SharePointing.Features.MetaTags.Controls;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;

namespace SharePointing.Features.MetaTags.WebParts
{
    /// <summary>
    /// This Web part displays what will be rendered in the MetaTagger
    /// but in a human readable format in the web page. Useful for debugging purposes.
    /// </summary>
    [Guid("BAAA3CB3-E06C-471a-9AED-2A98F92F7A98")]
    public class MetaTagViewer : System.Web.UI.WebControls.WebParts.WebPart
    {
        public MetaTagViewer()
        {
        }

        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            // TODO: add custom rendering code here.
            Label label = new Label();
            label.Text = "This Web Part allows you to inspect the contents of the MetaTags generated by the MetaTagger Control.<br>You must view the source of the page to see the tags generated. <br>Meta Tag Viewer Output:";
            this.Controls.Add(label);
            MetaTagger tagger = new MetaTagger();
            //Label outputLabel = new Label();
            //outputLabel.Text += "<MetaTags>";
            //outputLabel.Text += Common.Utilities.GetSiteMetaTags();
            //outputLabel.Text += "</MetaTags>";
            this.Controls.Add(tagger);
        }
    }
}